package com.doyens.search.pojo;

import org.elasticsearch.common.util.IntArray;

import java.util.Map;

public class SearchRequest {

    private String key;

    private static final Integer DEFAULT_SIZE = 20; // 每页大小 初始值

    private static final Integer DEFAULT_PAGE = 1; //默认页

    private Integer page;

    private Map<String,Object> filter;

    public Map<String, Object> getFilter() {
        return filter;
    }

    public void setFilter(Map<String, Object> filter) {
        this.filter = filter;
    }

    public Integer getSize() {
        if (size == null || size == 0){
            size = DEFAULT_SIZE;
        }
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    private Integer size;

    public Integer getPage() {
        if (page ==null || page == 0){
            page = DEFAULT_PAGE;
        }
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }


}
